home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d12
/
v10n02.arc
/
STACK.BAT
< prev
next >
Wrap
DOS Batch File
|
1991-01-10
|
550b
|
26 lines
@ECHO OFF
REM The environment variable stack_arg holds the subcommand
SET stack_arg=
:loop
REM If we reached a delimiter, execute the subcommand
IF '%1'=='!' GOTO execute
REM Keep building the subcommand
SET stack_arg=%stack_arg% %1
GOTO shift
:execute
REM Call the subcommand we've built
CALL %stack_arg%
REM Clear for the next subcommand
SET stack_arg=
:shift
SHIFT
REM If there are more commands, loop through again
IF NOT '%1'=='' GOTO :loop
REM Otherwise execute the last subcommand
CALL %stack_arg%
SET stack_arg=